
  Page({

    /**
     * 页面的初始数据
     */
    data: {
      swiperList: [],
      floorList:[],
      value: '',
    },
  
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
      // 1 发送异步请求 获取轮播图数据
      var reqTask = wx.request({
        url: 'http://122.112.245.197:5000/api/carouselDiagram',
        success: (result) => {
          this.setData({
            swiperList:result.data
          })
         }
       });      
     
    var zy = wx.request({
   url: 'http://122.112.245.197:5000/api/homePageInformation',
   success: (result) => {
   this.setData({
   floorList:result.data[0].floorList
  })
  // console.log(result.data[0].floorList)
    }
      })

      if(!wx.getStorageSync('iphone')){
        wx.showModal({
          cancelColor: 'cancelColor',
          title:"提示",
          content:"请先登录",
        })
      }
   },


   onChange(e) {
    this.setData({
      value: e.detail,
    });
  },
  onSearch() {
    // Toast('搜索' + this.data.value);
  },
  onClick(event) {
    // Toast('搜索' + this.data.value);
    console.log(event.currentTarget.dataset);
    var {aid}=event.currentTarget.dataset;
    wx.navigateTo({
      url: `../goods_list/index?id=${aid}`,
    })
  },
   
    })